﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Data;
using System.IO;
using System.Drawing;
public partial class administrator_uc_admin_a_cartorder : WebPageSecurity
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CommonBLL.RegisterCKFinder(CKEditorBody);     
        }
    }   
    protected void lbtAddNewItem_Click(object sender, EventArgs e)
    {
        try
        {
            new CmsBLL().CartOrder_InsertItem(txtTitle.Text, CKEditorBody.Text + "", DateTime.Now, txtSender.Text + "", txtEmail.Text + "", txtPhone.Text + "");
            lblMessage.Text = "Thêm mới thành công!";         
            ResetForm();
        }
        catch (Exception ex)
        {
            lblMessage.Text = "ERROR! " + ex.Message.ToString();
        }
    }
    private void ResetForm()
    {
        txtSender.Text = "";
        txtEmail.Text = "";
        txtPhone.Text = "";
        txtTitle.Text = "";
        CKEditorBody.Text = "";        
        txtSender.Focus();
    }
}